
<!-- link引入 -->
{include file="common::link"}
{include file="common::pagestyle"}
<body>
<div class="x-body">
    <button class="layui-btn layuiadmin-btn-useradmin" style="margin: 10px;cursor: not-allowed;">回收站删除后不可恢复 同时也会删除对应的源文件
      <i class="layui-icon">&#xe62e;</i> 共有数据：{$count} 条
    </button>
<!--    <span class="x-right" style="line-height:40px">共有数据：{$count} 条</span>-->

  <table class="layui-table">
    <thead>
    <tr>
      <th style="text-align: center;">ID</th>
      <th style="text-align: center;">申请报销人</th>
      <th style="text-align: center;">性别</th>
      <th style="text-align: center;">摘要</th>
      <th style="text-align: center;">报销金额</th>
      <th style="text-align: center;">电子发票</th>
      <th style="text-align: center;">报销单</th>
      <th style="text-align: center;">时间</th>
      <th style="text-align: center;">状态</th>
      <th style="text-align: center;">操作</th>
    </thead>
    <tbody>
    {foreach $res as $v}
    <tr>
      <td style="text-align: center;">{$v.id}</td>
      <td style="text-align: center;">{$v.name}</td>
      <td style="text-align: center;">
        {if condition = "$v.sex eq 1"}男{elseif condition = "$v.sex eq 2"/}女{else /}中性{/if}
      </td>
      <td style="text-align: center;">{$v.content|cut_str=###,10}</td>
      <td style="text-align: center;"><b style="color: deeppink">￥</b><b>{$v.money}</b></td>
      <?php $str = 'http://sact.com'; ?>
      <td style="text-align: center;">
        {if condition = "$v.electronic_invoice neq '' "}
        <img src="{$str.$v.electronic_invoice}">
        {else/}
        暂无图片
        {/if}
      </td>
      <td style="text-align: center;">
        {if condition = "$v.reimbursement neq '' "}
        <img src="{$str.$v.reimbursement}">
        {else/}
        暂无图片
        {/if}
      </td>

      <td style="text-align: center;">
        {if condition = "$v.update_time neq '' "}
          {$v.update_time|date="Y-m-d H:i:s"}
        {else/}
          {$v.create_time|date="Y-m-d H:i:s"}
        {/if}
      </td>
      <td style="text-align: center;">
        {if condition="$v.status eq 0"}
        <span class="layui-badge">待处理</span>
        {else/}
        <span class="layui-badge layui-bg-green">已处理</span>
        {/if}
      </td>
      <td class="td-manage" style="text-align: center;">
        <button class="layui-btn layui-btn-xs" onclick="del({$v.id})"><i class="layui-icon"></i></button>
      </td>
    </tr>
    {/foreach}
    </tbody>
  </table>
  <div class="page" style="margin:10px">{$res|raw}</div>

</div>

<!-- js引入 -->
{include file="common::script"}

<script>
  layui.use(['layer'], function () {
    layer = layui.layer;
    $ = layui.jquery;
  });

  /*用户-添加*/
  function add() {
    layer.open({
      maxmin: true,
      title: '添加',
      shade: [0.8, '#393D49'],
      area: ['460px', '420px'],
      type: 2,
      content: 'addment',
    });
  }

  /*用户-编辑*/
  function edit(id) {
    layer.open({
      maxmin: true,
      title: '编辑',
      shade: [0.8, '#393D49'],
      area: ['460px', '420px'],
      type: 2,
      content: 'editment?id=' + id,
    });
  }

  /*用户-删除*/
  function del(id) {
    layer.confirm('确认要删除吗？', {
      btn: ['确认', '取消']
    }, function () {
      //发异步删除数据
      $.post('recycleBinDel', { 'id': id }, function (res) {
        if (res.code > 0) {
          layer.alert(res.msg, { icon: 5 });
        } else {
          layer.msg(res.msg);
          setTimeout(function () {
            window.location.reload()
          }, 1000);
        }
      }, 'json');
    });
  }


</script>
</body>
